function Promise(executor) {
    //添加属性
    this.PromiseState='pending';
    this.PromiseResult=null;
    const self = this;
    //resolve 函数
    function resolve(data){
        //判断状态
        if(self.PromiseState !== 'pending') return;
        //1.修改对象的状态
        self.PromiseState = 'fulfilled';//resolved
        //2. 设置对象结果值
        self.PromiseResult = data

    }
    //reject 函数
    function reject(data){
        if(self.PromiseState !== 'pending') return;
        //1.修改对象的状态
        self.PromiseState = 'rejected';
        //2. 设置对象结果值
        self.PromiseResult = data
    }
    //执行器函数式同步的
    try {
        executor(resolve,reject);
    }catch (e) {
        reject(e
        )
    }
}

Promise.prototype.then = function (onResolved, onRejected) {

}
